home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0793july.archive / 000027_crash!mead.u.wa…ton.edu!cybele_Mon, 12 Jul 93 21:49:57 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  1KB

  1. Received: by bkhouse.cts.com (V1.16/Amiga)
  2.     id AA00000; Mon, 12 Jul 93 21:49:57 PST
  3. Received: from mead.u.washington.edu by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #15) id m0oFbk0-00018rC; Mon, 12 Jul 93 21:13 PDT
  5. Received: by mead.u.washington.edu
  6.     (5.65/UW-NDC Revision: 2.28 ) id AA27201; Mon, 12 Jul 93 21:13:19 -0700
  7. Date: Mon, 12 Jul 93 21:13:19 -0700
  8. Message-Id: <9307130413.AA27201@mead.u.washington.edu>
  9. From: Jason Simpson <cybele@mead.u.washington.edu>
  10. To: amigae@bkhouse.cts.com
  11. Subject: Rnd() not very random, Mod() not quite working?
  12.  
  13.  
  14.   Has anyone else noticed that Rnd() on small ranges (2-4 or so) doesn't
  15. produce very random results? Try a routine like:
  16.  
  17.     LOOP
  18.         x := Rnd(640)
  19.         y := Rnd(400)
  20.         c := Rnd(2) + 1  /* To offset from the background */
  21.         Plot( x, y, c )
  22.     ENDLOOP
  23.  
  24.   You should notice prominent bands of color.
  25.  
  26.   Also, when experimenting with RndQ(), I found that the Mod() function
  27. didn't always return the expected value, for example Mod(40000001,400)
  28. produces the result "610" -- it seems to do this mostly with larger numbers.
  29.  
  30.   Am I making incorrect assumptions here, or is there something wrong?